import {useState} from "react";

function App() {
    const [tep, setTep] = useState(3)
    const [age, setAge] = useState(17)
    const [isLogin, setLogin] = useState(false)

    const renderScreen = () => {
        if (tep === 0) {
            return <button>0</button>
        } else if (tep === 1) {
            return <button>1</button>
        } else if (tep === 2) {
            return <button>not</button>
        } else {
            return false
        }
    }
    return (
        <div className="App">
            {
                isLogin ? <button>退出登录</button> : <button>登录</button>
            }
            {
                age >= 18 ? <button>成年</button> : <button>未成年</button>
            }
            <button>{renderScreen().toString()}</button>
            {
                renderScreen() && <button>{renderScreen()}</button>
            }
        </div>
    );
}

export default App;
